import { NextFunction } from "express"

// 通用响应格式
export interface ApiResponse<T = any> {
    code: number
    message: string
    data: T
}

// 分页请求参数
export interface PaginationParams {
    page: number
    pageSize: number
}

// 用户相关类型
export interface User {
    id: string
    username: string
    password: string
    avatar: string
    email?: string
    role: string
    createdAt: Date
    updatedAt: Date
}

// 帖子相关类型
export interface Post {
    id: string
    title: string
    content: string
    authorId: string
    createdAt: Date
    updatedAt: Date
    likes: number
    comments: number
}

// 请求处理中间件类型
export interface RequestHandler<T = any> {
    (req: Request, res: Response, next: NextFunction): Promise<T> | T
} 